package com.dxtan90.util;

import java.io.File;

public class FormatUtil {
    public static boolean isImage(File file){
        return isImage(file.getName());
    }
    public static boolean isImage(String fileName){
        if(fileName == null || "".equals(fileName.trim()))return false;

        String suffix = fileName.substring(fileName.lastIndexOf('.'));

        return ".JPG".equals(suffix.toUpperCase()) ||
                ".PNG".equals(suffix.toUpperCase()) ||
                ".JEPG".equals(suffix.toUpperCase());
    }
}
